/*
 * Copyright (c) 2023 Huawei Technologies Co., Ltd.
 * openUBMC is licensed under Mulan PSL v2.
 * You can use this software according to the terms and conditions of the Mulan PSL v2.
 * You may obtain a copy of Mulan PSL v2 at:
 *         http://license.coscl.org.cn/MulanPSL2
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PSL v2 for more details.
 */

#ifndef GEN_OBJECT_PCIE_GPU_CARD_H
#define GEN_OBJECT_PCIE_GPU_CARD_H

#include <device_tree/base.h>
#include <device_tree/interface/PCIeCard.h>
#include <device_tree/interface/PCIeDevice.h>

namespace dev::gen {

/**
 * @brief PCIe GPU卡驱动类
 *
 * 实现PCIe GPU卡的驱动功能
 */
class MC_API pcie_gpu_card : public mc::engine::object<pcie_gpu_card> {
public:
    MC_OBJECT(pcie_gpu_card, "PCIeGpuCard", "/bmc/dev/Systems/${SystemId}/PCIeGpuCard/${Id}",
              (PCIeDevice)(PCIeCard))

    virtual bool init(const mc::dict& config) = 0;
    virtual bool stop()                       = 0;
    virtual bool start()                      = 0;

    PCIeDevice m_pcie_device;
    PCIeCard   m_pcie_card;
};

} // namespace dev::gen

#endif // GEN_OBJECT_PCIE_GPU_CARD_H